package com.example.houduan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.houduan.entity.All;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface AllMapper extends BaseMapper<All> {
    @Select({
            "SELECT * FROM bl WHERE name LIKE CONCAT('%', #{name}, '%')",
            "UNION ALL",
            "SELECT * FROM chunai WHERE name LIKE CONCAT('%', #{name}, '%')",
            "UNION ALL",
            "SELECT * FROM ys WHERE name LIKE CONCAT('%', #{name}, '%')",
            "UNION ALL",
            "SELECT * FROM yq WHERE name LIKE CONCAT('%', #{name}, '%')",
            "UNION ALL",
            "SELECT * FROM wucp WHERE name LIKE CONCAT('%', #{name}, '%')"
    })
    List<Map<String, Object>> getAllList(@Param("name") String name);
}
